import { defineStore } from 'pinia'
import { ref } from 'vue'

export const useAuthStore = defineStore('auth', () => {
  const loginStatus = JSON.parse(localStorage.getItem('isLogin'))
  const isLogin = ref(loginStatus || false)

  const setLogin = (val) => {
    isLogin.value = val
  }

  return { isLogin, setLogin }
},{
  persist: true
})
